//
//  BTIntroViewController.m
//  BaseTools
//
//  Created by 李挺哲 on 15/8/27.
//  Copyright (c) 2015年 ltz. All rights reserved.
//

#import "BTIntroViewController.h"
#import "BTIntroView.h"
@interface BTIntroViewController ()<BTIntroViewDelegate>
@property (nonatomic,strong)BTIntroView * introView;


@end

@implementation BTIntroViewController

- (void)viewDidLoad {
      [ super viewDidLoad];
    [self initNavigationTitle:@"起始页面" barTintColor:0x1E86CB titleColor:0xFFFFFF isTranslucent:NO isHidden:NO];
    [self showNavigationLeftButtonTitle:@"返回" tintColor:0xFFFFFF];
    self.navigationController.navigationBar.hidden=YES;
    self.navigationController.navigationBar.translucent=NO;
    
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
//    if (![defaults objectForKey:@"intro_screen_viewed"]) {
    self.introView = [[BTIntroView alloc] initWithFrame:self.view.frame];
    self.introView.delegate = self;
    self.introView.backgroundColor = [UIColor greenColor];
    [self.view addSubview:self.introView];
//    }
    
//    else{
//        self.navigationController.navigationBar.hidden=NO;
//
//    }
  

}



-(void)onNextButtonPressed{
    
//    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
//    [defaults setObject:@"YES"forKey:@"intro_screen_viewed"];
//    [defaults synchronize];

    [UIView animateWithDuration:1.0 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
        self.introView.alpha = 0;
          self.navigationController.navigationBar.hidden=NO;
        
    } completion:^(BOOL finished) {
        [self.introView removeFromSuperview];
    }];




}



@end
